import { request } from "@/utils";

//1.频道下拉框选项
export function getChannelAPI() {
    return request({
        url: `/index/channels`,
        method: 'GET'

    })
}

//2.提交文章表单
export function creatArticleAPI(data) {
    return request({
        url: '/article/goal',
        method: 'POST',
        data
    })
}

//3.获取文章列表
export function getArticleListAPI(params) {
    return request({
        url: "/article/items",
        mathod: 'GET',
        params
    })
}

//4.删除文章
export function delArticleAPI(artId) {
    return request({
        url: `/article/del/${artId}`,
        method: 'DELETE'
    })
}

//5.获取文章详情
export function getArticleById(id) {
    return request({
        url: `/article/only/${id}`
    })
}

//6.更新文章表单
export function updateArticleAPI(data) {
    return request({
        url: '/article/update',
        method: 'PUT',
        data
    })
}